{{- if .Title | and .Text -}}
  <figure>
    {{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" true "Responsive" true | partial "plugin/image.html" -}}
    <figcaption class="image-caption">
      {{- .Text | safeHTML -}}
    </figcaption>
  </figure>
{{- else -}}
  {{- $linked := (eq (.Page.Scratch.Get "params").lightgallery "force") | or (ne .Title "") -}}
  {{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Responsive" true | partial "plugin/image.html" -}}
{{- end -}}
